package com.naiterui.common.jinshuju.event;

import org.springframework.scheduling.annotation.Async;

import lombok.extern.slf4j.Slf4j;

/**
 * 金数据保存成功后业务事件处理类
 * 宿主业务项目中自定义Event接受处理逻辑
 * 支持按照uid、formId、bizId 维度组合筛选
 * 注：
 * 实际业务处理逻辑需要异步不影响回调逻辑，务必添加@Async
 * 并在Springboot 启动类添加@EnableAsync 启动异步
 */
//@Component
@Slf4j
public class JinshujuEventHandler {

    /**
     * XXX问卷回调
     *
     * @param jinshujuEvent
     */
    @Async
    //@EventListener(classes = JinshujuEvent.class, condition = "#root.args[0].uid == " + "'XXXX'")
    //@EventListener(classes = JinshujuEvent.class, condition = "#root.args[0].formId == " + "'XXXX'")
    //@EventListener(classes = JinshujuEvent.class, condition = "#root.args[0].bizId == " + "'XXXX'")
    public void planCallback(JinshujuEvent jinshujuEvent) {

        log.info(" jinshuju callback info {}", jinshujuEvent.getJinshujuInfo());
    }
}
